<template>
<!--  <view class="custom-navigation-bar">
    <view class="left" @click="navigateBack">
      <image class="back-icon" src="/static/images/back.png"></image>
    </view>
    <view class="title">{{ title }}</view>
    <view class="right">
      
    </view>
  </view> -->
  <view style="position: fixed;top: 0rpx;left:0rpx;height: 150rpx;background-color: #2AE8DC;width: 100%;z-index: 999;"> 
	<view style="width: 50rpx;height: 50rpx;margin-top: 80rpx;margin-left: -20rpx;" >
  	  <image class="back-icon" src="/static/images/back.png" style="width: 50rpx;height: 50rpx;margin-left: 50rpx;z-index: 999;" @click="navigateBack"></image>
  	</view> 
	<view class="title">{{ title }}</view>
  </view>
</template>
 
<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    navigateBack() { 
	
		const pageSize= getCurrentPages().nv_length;
		if(pageSize==1){
			wx.switchTab({
			  url: "/pages/home/home",
			  success: function(res) {
			    // 跳转成功
			  },
			  fail: function(err) {
			    // 错误处理
			  }
			})
			return;
		} 
		uni.navigateBack()
    }
  }
}
</script>
 
<style scoped>
.custom-navigation-bar {
  position: fixed;
  width: 100%;
  top: 0;
  align-items: center;
  justify-content: space-between;
  height: 150rpx;
  padding: 0 75rpx;
  background: #2AE8DC;
  z-index: 999;
 /* border-bottom: 1px solid #e5e5e5; */
}
 
.left {
  position: fixed;
  top: 80rpx;
  align-items: center;
  justify-content: flex-start;
  margin-left: -30rpx;
}
 
.back-icon {
  width: 40rpx;
  height: 40rpx; 
}
 
.title {
  left: 0rpx;
  text-align: center;
  font-size: 35rpx;
  color: white;
  font-weight: bold;
  margin-top: -40rpx;
}
 
.right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
</style>